//
//  OCTempViewController.m
//  ocVB
//
//  Created by apple on 2016/10/24.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "OCTempViewController.h"
#import "OCLoadViewController.h"
#import "OCNavigationController.h"
#import "OCUserInfoViewModel.h"
#import "OCTempView.h"


@interface OCTempViewController ()

@end

@implementation OCTempViewController

-(void)loadView{
    self.login = [OCUserInfoViewModel sharedInfoModel].isLogin;
    if (!_login) {
        self.tempV = [[OCTempView alloc] init];
        //解决循环引用
        __unsafe_unretained  typeof(self) weakSelf = self;
        self.tempV.callBack = ^{
            [weakSelf jumpLoad];
        };
        self.view = self.tempV;
        
    }else{
        [super loadView];
    }
}
- (void)jumpLoad{
    
    NSLog(@"四个按钮被点击了");
    OCLoadViewController *vc = [[OCLoadViewController alloc] init];
    OCNavigationController *nav = [[OCNavigationController alloc] initWithRootViewController:vc];
    [self presentViewController:nav animated:YES completion:nil];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setNav];
    
}
-(void)setNav{
    
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"登录" style:UIBarButtonItemStylePlain target:self action:@selector(jumpLoad)];
    
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"注册" style:UIBarButtonItemStylePlain target:self action:@selector(jumpLoad)];
    
    
    
}

@end
